UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lmgHbyOpo0zsom0Oupl3Ltt2l4g3jaUOieg1ZeurdWw=' 
WHERE 
  key_id = '88d9eb76fd57c1a462d155f0185486daa1abaaea8271051d4ad54807fc7eb572' 
  AND (
    token = 'lmgHbyOpo0zsom0Oupl3Ltt2l4g3jaUOieg1ZeurdWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019