UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pp51WrlPbMrukBd4AJ2JBggL163fXQCXV19NVbYEnks=' 
WHERE 
  key_id = '473de6afc7bd3da0c9f484bfeafba029c955b99804d64e11946df0229320bca0' 
  AND (
    token = 'Pp51WrlPbMrukBd4AJ2JBggL163fXQCXV19NVbYEnks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022