UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TarlZdvx/2GlYglTLkUzT8ZOorb1lE9vS77jMjV4svM=' 
WHERE 
  key_id = '6f9328ad132807cc457d12e87002a968e22478b86e38cef2c5b5a8765a4398db' 
  AND (
    token = 'TarlZdvx/2GlYglTLkUzT8ZOorb1lE9vS77jMjV4svM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034