UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWzPP6zQO7AbJfaTs9miCB/B9fvtjqhOmbk9bcKrE9I=' 
WHERE 
  key_id = '7e0346b8245519f5755db4abea3029ebc585ac4d021182c3b32d0693bddcddc6' 
  AND (
    token = 'TWzPP6zQO7AbJfaTs9miCB/B9fvtjqhOmbk9bcKrE9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029