UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dR9QTJajmQD949Eib7+ptZZJ86h95FDLZe9nJlVmUNw=' 
WHERE 
  key_id = '5efb0efaa6a35f2fad632fbbf9f9525ffe79cb3ede7bf0c22769467e1b825e70' 
  AND (
    token = 'dR9QTJajmQD949Eib7+ptZZJ86h95FDLZe9nJlVmUNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020