UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2LgBE6gBrHpj0K1UrSiOoZoBpX6/T1yYPRLpcg4ac98=' 
WHERE 
  key_id = '3efb48d7a6a478ea2230b9e27498efbe20b94f6f16ddeedbf2d5fd9138ae0cae' 
  AND (
    token = '2LgBE6gBrHpj0K1UrSiOoZoBpX6/T1yYPRLpcg4ac98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028