UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0HINe5WcU6vwjcrXYUC9g5Mw2mEtER4npz6nwz+Q4to=' 
WHERE 
  key_id = '1100b104f1200343996fd8c9efb257adbfc1139b0b017cb5d2da0f478d0b6a83' 
  AND (
    token = '0HINe5WcU6vwjcrXYUC9g5Mw2mEtER4npz6nwz+Q4to=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035