UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qgXU1oWC3mqyWMdukL8XPLNamZs0Mutm1uiIyCM/r6I=' 
WHERE 
  key_id = '99c6538a7c1d4da94d831bf00d181d777f2dede0a741e18307a29ce4fcc07d57' 
  AND (
    token = 'qgXU1oWC3mqyWMdukL8XPLNamZs0Mutm1uiIyCM/r6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026