UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/cNW4qsbAzg7ATQoQEBalbYgr9XyJV3GDXbyhSEoQXU=' 
WHERE 
  key_id = 'a5f8ed6a5c5923d1c31404d96f5a28db177ca1e7497aa0d466fc15b2093f9556' 
  AND (
    token = '/cNW4qsbAzg7ATQoQEBalbYgr9XyJV3GDXbyhSEoQXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032