UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOrjELMoyxEE8krGNn/wjVWV7Br6Ob/41ApBOG5mMcc=' 
WHERE 
  key_id = '2ff9fa42561e84a7fa5ef703ee03ca52023f7879eabcde0bd70dd7c40bc86711' 
  AND (
    token = 'JOrjELMoyxEE8krGNn/wjVWV7Br6Ob/41ApBOG5mMcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016