UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c2XOlVsPPY/kPLQEzQ7+ZYqHo6FTxkiRWIMTsqgVVqg=' 
WHERE 
  key_id = '5ee55f5aefb6b2ec1635358690d9a6851972c7536ae220f855f04c2743f239bb' 
  AND (
    token = 'c2XOlVsPPY/kPLQEzQ7+ZYqHo6FTxkiRWIMTsqgVVqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038