UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/vVbgAyE0wf06xaK9N91/hMfaTqo/64ypWw/pLhxYUs=' 
WHERE 
  key_id = 'c2f1e7ecd82bd35189a5dd742694cba2b88fc24f4247ba0669f27f42bf92ea89' 
  AND (
    token = '/vVbgAyE0wf06xaK9N91/hMfaTqo/64ypWw/pLhxYUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064