UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q/G8Vv0TV1aqyTAPNQ7DI3lyxnKezylk7fhYc3oxk0c=' 
WHERE 
  key_id = '3b6ca111d73170b69bd0c50ba09e8b936009eb60194b5c4e31f484ab8af8b7c7' 
  AND (
    token = 'Q/G8Vv0TV1aqyTAPNQ7DI3lyxnKezylk7fhYc3oxk0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056