UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkkNNDYQOdX6vDZRffyaDzxkbH3Hn+Jmte9HpTAkgcE=' 
WHERE 
  key_id = '06c1681a1c81f7b87983e4b7790b46bebb2e56fae73225a9ae83eeee1ba921c1' 
  AND (
    token = 'hkkNNDYQOdX6vDZRffyaDzxkbH3Hn+Jmte9HpTAkgcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029