UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BcWDQ4mX/iPt7DnuDrPvcuLO8Rj/qsq+JQNieTJ86tQ=' 
WHERE 
  key_id = 'c6e3bdacdc4ef84571fe9e05a44f5beda4122c1b63bae97f5ddd7904f7ba220b' 
  AND (
    token = 'BcWDQ4mX/iPt7DnuDrPvcuLO8Rj/qsq+JQNieTJ86tQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032