UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9sNynknd+vnT5Ttx0Z1R5nIKcOkFXH0xvun0O3gYQiI=' 
WHERE 
  key_id = '0c9b596221d9e7bddafddc9b4292e7c6a951a51fd5a19ab426f66580ce1c5824' 
  AND (
    token = '9sNynknd+vnT5Ttx0Z1R5nIKcOkFXH0xvun0O3gYQiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046