UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4KLAuIjuFxzM+J4nruqVkY3Y5t+SBZqlAkSsSr9eejQ=' 
WHERE 
  key_id = '06cb5f917277c42b7a4a6633fb2fc694b03cf2bf27be69d6b97761044a61395b' 
  AND (
    token = '4KLAuIjuFxzM+J4nruqVkY3Y5t+SBZqlAkSsSr9eejQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023