UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dWzN1gSgUFBPvx41F5oE1iv3ayOtoZXCUnwjnQMYT9E=' 
WHERE 
  key_id = '14392900382a7fa2bb2b9a961f0c583e9a803ed0cdc1bfcb0f1b7640b101a41c' 
  AND (
    token = 'dWzN1gSgUFBPvx41F5oE1iv3ayOtoZXCUnwjnQMYT9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043