UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'beT01hy0/1DvezD1sv77YpHD6gZT+EAyWFyEPr4rExU=' 
WHERE 
  key_id = '9dcc3983c499a41e9432470f5caa6388cf7ac942faafc5237c9f722cb59ae884' 
  AND (
    token = 'beT01hy0/1DvezD1sv77YpHD6gZT+EAyWFyEPr4rExU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036