UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DPEmNMkWWQ8AKIbSx7ShdWdyc0YNavmaUYpjvkiCU5M=' 
WHERE 
  key_id = '6aebc75de25f1bd9446665d303c76263a430b8b3042c917b1930d384a29ae2b3' 
  AND (
    token = 'DPEmNMkWWQ8AKIbSx7ShdWdyc0YNavmaUYpjvkiCU5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021