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

Query time 0.00019