UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vC7Y5FxOeUf5iX11nZ+NxfGqFNmrFW4APBzdTRTGdEA=' 
WHERE 
  key_id = 'd0d88faeffa2724bcb75a44b280748025aa259b4ed5edb6e6235b4c2c9e3b11a' 
  AND (
    token = 'vC7Y5FxOeUf5iX11nZ+NxfGqFNmrFW4APBzdTRTGdEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033