UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sFzcLVzUJ2oyFXeUpcVc+ZtVxTo1ovsTbmDruCsbfE0=' 
WHERE 
  key_id = 'f32c5666588c559c76092f58c3a3e98bc602a0338e856f51ee4349374e0189cd' 
  AND (
    token = 'sFzcLVzUJ2oyFXeUpcVc+ZtVxTo1ovsTbmDruCsbfE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029