UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WQUO02wtvsnyLZ6KO+mRInIHutHp6KEFoXB1RIvhpUw=' 
WHERE 
  key_id = '2b26343d0b114c8aa66c1a9f07c5237cc27b8fc36bc39054a778bd69e1b78f0b' 
  AND (
    token = 'WQUO02wtvsnyLZ6KO+mRInIHutHp6KEFoXB1RIvhpUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021