UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '35kYR20MfWaikxHJrf5qhRgMrLTnRkUzkV/jBhPlTbY=' 
WHERE 
  key_id = '1f6af7308e4efcec21953cfc27f71715a7996c574beda4f7289111d82a4e2fdf' 
  AND (
    token = '35kYR20MfWaikxHJrf5qhRgMrLTnRkUzkV/jBhPlTbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036