UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xb+8OeFZHy8MBKeTIZCw+ja4fwU7l2SweP9mMkkne7w=' 
WHERE 
  key_id = '01542bdbc705b6948b3e58f0fd2ec94fa97ae06057d36463562d14a0e9aef4f9' 
  AND (
    token = 'xb+8OeFZHy8MBKeTIZCw+ja4fwU7l2SweP9mMkkne7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028