UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hlh4u1TPg7S18a+/7tYXNEXTwztn6HsfR2HpHQ9sQWk=' 
WHERE 
  key_id = '5949a541666a4661d140b5a70cb5a3c830a1b46042a2cf219d9b011b4a97f692' 
  AND (
    token = 'hlh4u1TPg7S18a+/7tYXNEXTwztn6HsfR2HpHQ9sQWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057