UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jKeKKKcDuz2EV7REq/R5JJ7oTMnKQcPqWjIplwiZ5HU=' 
WHERE 
  key_id = 'd3e150a118394328bf44234342d797f854441e234d102877849c556f8d3a5015' 
  AND (
    token = 'jKeKKKcDuz2EV7REq/R5JJ7oTMnKQcPqWjIplwiZ5HU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024