UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RLLTn8U/xwYuey7S5Gj5n1f6eFffAg4Wy66IzqHASQA=' 
WHERE 
  key_id = '24e5bc7a2f4846f893b5bfaf6bd6186b8bae12af2722f16b6f36384856466c73' 
  AND (
    token = 'RLLTn8U/xwYuey7S5Gj5n1f6eFffAg4Wy66IzqHASQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021