UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dtiNTLMeFRpgw90H24umY23JaxOwfLEad5bFLvKHmJ8=' 
WHERE 
  key_id = '0b85979284a631c2a3bc6eeabf3254cdd41985684b2c23cdd49212ff391c239d' 
  AND (
    token = 'dtiNTLMeFRpgw90H24umY23JaxOwfLEad5bFLvKHmJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069