UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hi8kV9YWEmMwHtfroT/E/E9l8LzcwML7QQXYC33rs/E=' 
WHERE 
  key_id = '5c222d9e19e8d7a31a6d1d37600fd917364fabd6cf9ae19b8a6c9e0b1f470d94' 
  AND (
    token = 'Hi8kV9YWEmMwHtfroT/E/E9l8LzcwML7QQXYC33rs/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048