UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'albO6ZRUnh0rZALG3ihLVgu27MZGWymVRz2qLX3beZM=' 
WHERE 
  key_id = 'e28b3792e568513ec9efa87b188d2bd71dc0e5dd4ed85c200b63e1afa6943e01' 
  AND (
    token = 'albO6ZRUnh0rZALG3ihLVgu27MZGWymVRz2qLX3beZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030