UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MmlrbbcfmtnhyZBtgUZ9ME47CisrZq7K3qAOrj7c3tw=' 
WHERE 
  key_id = '994fdd26c00f8de17e2b147dbfce2f0f4c9b3acffa35de30efbe5fe6de1a4ba6' 
  AND (
    token = 'MmlrbbcfmtnhyZBtgUZ9ME47CisrZq7K3qAOrj7c3tw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020