UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'giFVNCBw8Vj54W4DKpiIUuJISosQ27HmNlNMM95v7WU=' 
WHERE 
  key_id = '008e62ca82248cc4659be546cf50c58d1a0c44709d23acce85adc2c34d755918' 
  AND (
    token = 'giFVNCBw8Vj54W4DKpiIUuJISosQ27HmNlNMM95v7WU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036