UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QHb+d+1t4kai9oX7Cp7LIuTx8GGQ5TLl+s/Bvi1q/OQ=' 
WHERE 
  key_id = '18a98989fa56704832faf1e921ba42b6c27bd5ec256b382af2cd37a9e1a998af' 
  AND (
    token = 'QHb+d+1t4kai9oX7Cp7LIuTx8GGQ5TLl+s/Bvi1q/OQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018